<template>
  <div class="EmergencyList">
    <div class="flex location-wrap">
      <span class="white">当前位置：</span>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/EWManagement' }">预警管理</el-breadcrumb-item>
        <el-breadcrumb-item>预警研判</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="box">
      <!-- 列表筛选 -->
      <filterTitle @query="query" @reset="reset" :form="form" labelWidth="140px" :formData="formData">
        <!-- <el-form slot="filter" class="form" ref="form" :model="form" inline size="small" labelWidth="140px">
          <el-form-item :label="item.label + '：'" v-for="(item, index) in formData" :key="index" :prop="item.id">
            <LsdForm :compData="item" :form="form" />
          </el-form-item>
        </el-form> -->
      </filterTitle>
      <!-- 列表表格 -->
      <LsdTable slot="gjxm" @select="handleSelectionChange" :paginationAtrrs="paginationAtrrs"
        @pageChange="handleSizeChange" :compRef="table.compRef" ref="gjxm" :columns="table.columns" :title="table.title"
        :actions="table.actions" :tableData="table.tableData" :tableAttr="table.tableAttr" :isShowPage="table.isShowPage"
        :isSelectFlag="table.isSelectFlag" :isSequenceFlag="table.isSequenceFlag" @onActionClick="onActionClick" />
    </div>
    <!-- 弹窗信息 -->
    <LsdDialog :dialogConfig="dialogConfig" @handleBtn="handleBtn" @close="close">
      <LsdDialogTitle slot="dialog" :titleConfig="titleConfig" :activeNames="activeNames">
        <DialogForm ref="formComponent" slot="slot1" :formConfig="formConfig" @changeEvent="handleChange" />
        <LsdTable slot="slot2" :compRef="tables.compRef" ref="gjxm" :autoHeight="tables.autoHeight"
          :columns="tables.columns" :title="tables.title" :actions="tables.actions" :tableData="tables.tableData"
          :tableAttr="tables.tableAttr" :isShowPage="tables.isShowPage" :isSelectFlag="tables.isSelectFlag"
          :isSequenceFlag="tables.isSequenceFlag" />
        <DialogForm ref="formComponent1" @removeTag="removeTag" @pickerChange="pickerChange" slot="slot3"
          :formConfig="formConfig1" @handleNodeClick="handleNodeClick" />
        <DialogForm ref="formComponent2" slot="slot4" :formConfig="formConfig2" />
        <DialogForm ref="formComponent3" slot="slot5" :formConfig="formConfig3" />
      </LsdDialogTitle>
    </LsdDialog>
    <!-- 弹窗信息研判结果 -->
    <LsdDialog :dialogConfig="dialogConfig1" @handleBtn="handleBtn1" @close="close1">
      <LsdDialogTitle slot="dialog" :titleConfig="titleConfig1" :activeNames="activeNames1">
        <DialogForm ref="formComponent4" slot="slot1" :formConfig="formConfig4" />
        <DialogForm ref="formComponent5" slot="slot2" :formConfig="formConfig5" />
      </LsdDialogTitle>
    </LsdDialog>
  </div>
</template>

<script>
import {
  warningJudgeGetInfoData, warningJudgeGetNoJudgeInfo,
  saveAdd, deleteById, getByIds, updById, getJudgeStandard, getEditNoJudgeInfo, listPagey
} from "@/api/EarlyWarningManagement/yjyp.js";
import { getPersonApi } from "@/api/EarlyWarningManagement/yjtzd";
import { getById, getIssueNoticeList, getCityTree } from "@/api/EarlyWarningManagement/yjxxsj";
import { tables } from "./components/config";
import { getDictByGroup } from "@/api/common.js";
import { showTime } from "@/lib";
import { flowSubmit } from "@/utils/flow";
export default {
  name: "InformationList",
  components: {},
  data() {
    return {
      tables: tables, // 研判标准
      type: 0,
      roleObj: {},
      multipleSelection: [],
      // 筛选信息
      formData: [
        {
          elType: "input",
          id: "judgeName",
          label: "预警研判单",
          attrs: {
            value: "",
            clearable: true,
            size: "small"
          }
        },
        {
          elType: "select",
          id: "dangerCode",
          label: "险情类别",
          dic: "dic_xqlb",
          attrs: {
            value: "",
            size: "small",
            clearable: true,
            filterable: true,
            "collapse-tags": true
          },
          options: []
        },
        {
          elType: "select",
          id: "warningLvCode",
          label: "预警级别",
          dic: "dic_yjjb",
          attrs: {
            value: "",
            clearable: true,
            size: "small",
            filterable: true,
            "collapse-tags": true
          },
          options: []
        },
        {
          elType: "input",
          id: "effectRange",
          label: "影响范围",
          attrs: {
            value: "",
            size: "small",
            clearable: true,
            filterable: true,
            "collapse-tags": true
          }
        },
        {
          elType: "dateTimePicker",
          id: "judgeTime",
          label: "研判时间",
          attrs: {
            value: "",
            size: "small",
            clearable: true,
            type: "datetimerange",
            "start-placeholder": "开始日期",
            "end-placeholder": "结束日期",
            "value-format": "yyyy-MM-dd HH:mm:ss"
          }
        },
        {
          elType: "select",
          id: "isWarningCode",
          label: "是否启动预警",
          attrs: {
            value: "",
            size: "small",
            clearable: true,
            filterable: true,
            "collapse-tags": true
          },
          options: [
            { label: "否", value: "0" },
            { label: "是", value: "1" }
          ]
        },
        {
          elType: "select",
          id: "noticeId",
          label: "关联预警通知单",
          attrs: {
            value: "",
            size: "small",
            clearable: true,
            filterable: true,
            "collapse-tags": true
          },
          options: []
        },
        {
          elType: "select",
          id: "judgeState",
          label: "状态",
          attrs: {
            value: "",
            size: "small",
            clearable: true,
            filterable: true,
            "collapse-tags": true
          },
          options: [
            { label: "编辑中", value: "0" },
            { label: "待审批", value: "1" },
            { label: "已审批", value: "2" },
            { label: "驳回", value: "3" }
          ]
        }
      ],
      // 表格信息
      table: {
        isSelectFlag: false, // 是否展示选择器
        compRef: "gjxm",
        isSequenceFlag: true, // 是否展示序号
        isShowPage: true, // 是否展示分页
        resetFlag: true,
        loading: false,
        title: "预警研判单列表",
        actions: [
          {
            id: "dialogVisible",
            text: "新增",
            type: "primary",
            btnAttr: { size: "small" }
          }
        ],
        tableData: [],
        columns: [
          {
            prop: "judgeName",
            label: "预警研判单",
            align: "left",
            "min-width": "230px",
            render: (h, { row }) => {
              return (
                <div>
                  {
                    <span
                      style='width: 100%;' class='commonTableStyle'
                      {...{
                        on: {
                          click: () => {
                            this.detailList(row);
                          }
                        }
                      }}
                    >
                      {row.judgeName}
                    </span>
                  }
                </div>
              );
            }
          },
          {
            prop: "dangerName",
            label: "险情类别",
            align: "center"
          },
          {
            prop: "warningLvName",
            label: "预警级别",
            align: "center"
          },
          {
            prop: "effectRange",
            label: "影响范围",
            align: "center",
            "min-width": "120px"
          },
          {
            prop: "judgeTime",
            label: "研判时间",
            align: "center",
            "min-width": "120px"
          },
          {
            prop: "isWarning",
            label: "是否启动预警",
            align: "center"
          },
          {
            prop: "warningNoticeName",
            label: "关联预警通知单",
            align: "left",
            "min-width": "200px",
            render: (h, { row }) => {
              return (
                <div>
                  {
                    <span
                      style='width: 100%;' class='commonTableStyle'
                      {...{
                        on: {
                          click: () => {
                            this.$router.push({
                              name: "NoticeDetail",
                              query: { id: row.noticeId }
                            });
                          }
                        }
                      }}
                    >
                      {row.warningNoticeName}
                    </span>
                  }
                </div>
              );
            }
          },
          {
            prop: "judgeState",
            label: "状态",
            align: "center",
            "min-width": "100px",
            formatter: (row, column, cellValue, index) => {
              if (cellValue === "0") {
                return "编辑中";
              } else if (cellValue === "1") {
                return "待审批";
              } else if (cellValue === "2") {
                return "已审批";
              } else if (cellValue === "3") {
                return "驳回";
              }
            }
          },
          {
            prop: "cz",
            label: "操作",
            align: "center",
            "min-width": "120px",
            render: (h, scope) => {
              let arr = [];
              const userId = JSON.parse(sessionStorage.getItem("account")).id;
              const tbPower = this.common.isHasPower("tbr");
              // const spPower = this.common.isHasPower("spr");
              console.log(tbPower, "tbPowertbPower");
              if (["0", "3"].includes(scope.row.judgeState) && tbPower) {
                arr = ["编辑", "删除"];
              } else if (scope.row.judgeState === "1" && scope.row.nextAssignee && scope.row.nextAssignee.includes(userId) && scope.row.operate === true) {
                arr = ["审批"];
              } else if (scope.row.judgeState === "2" && scope.row.warningNoticeName === null && tbPower && scope.row.isWarning == "是" && scope.row.operate === true) {
                arr = ["生成预警通知单"];
              } else {
                arr = [];
              }
              return (
                <div>
                  {
                    arr.map(item => {
                      return (
                        <span style='color:#3561fd;cursor:pointer;margin:0 2px' {...{
                          on: {
                            click: () => {
                              this.actionHandle(item, scope);
                            }
                          }
                        }}>
                          {item}
                        </span>
                      );
                    })
                  }
                </div >
              );
            }
          }
        ],
        // 表格样式
        tableAttr: {
          // "max-height": "430px",
          // height: "430px",
          border: true,
          fit: true,
          stripe: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      // 分页信息
      paginationAtrrs: {
        total: 0,
        "background": true,
        layout: "prev, pager, next",
        "current-page": 1,
        "page-size": 10
      },
      activeNames: ["1", "2", "3", "4", "5"], // 折叠面板默认展开列
      activeNames1: ["1", "2"], // 折叠面板默认展开列
      form: {}, // 筛选from
      pageNum: 1,
      pageSize: 10,
      // 弹窗信息
      dialogConfig: {
        title: "预警研判单",
        isShow: false, // 弹窗显示隐藏
        btnList: []
      },
      // 弹窗信息
      dialogConfig1: {
        title: "研判结果处理",
        isShow: false, // 弹窗显示隐藏
        width: "60%",
        btnList: [
          {
            name: "生成预警通知单",
            id: "GenerateAlertNotice", // 事件名
            type: "primary",
            size: "small"
          },
          {
            name: "取消",
            id: "Qxiao",
            size: "small"
          }
        ]
      },
      // 折叠面板信息
      titleConfig: [
        {
          title: "预警信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "研判标准",
          name: "2",
          slot: "slot2"
        },
        {
          title: "研判结果",
          name: "3",
          slot: "slot3"
        },
        {
          title: "填报信息",
          name: "4",
          slot: "slot4"
        }
        // {
        //   title: "审批信息",
        //   name: "5",
        //   slot: "slot5"
        // }
      ],
      // 折叠面板信息
      titleConfig1: [
        {
          title: "研判结果",
          name: "1",
          slot: "slot1"
        },
        {
          title: "审批信息",
          name: "2",
          slot: "slot2"
        }
      ],
      // 弹窗表单信息
      formConfig: {
        formData: [
          {
            type: "select",
            label: "预警信息",
            isDisabled: false,
            prop: "infoIds",
            name: "warningInfoNames",
            class: "sjgy",
            lableWidth: "140px",
            multiple: true,
            option: []
          },
          {
            type: "input",
            label: "险情类别",
            prop: "dangerName",
            name: "dangerName",
            isDisabled: true,
            class: "half",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "预警级别",
            prop: "warningLvName",
            name: "warningLvName",
            isDisabled: true,
            class: "half",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "影响范围",
            prop: "effectRange",
            isDisabled: true,
            class: "half",
            lableWidth: "140px"
          },
          {
            type: "dataPicker",
            label: "影响时间",
            prop: "effectStartTime",
            start: "effectStartTime",
            end: "effectEndTime",
            isDisabled: true,
            class: "half",
            dateType: "datetimerange",
            lableWidth: "140px"
          },
          {
            type: "textarea",
            label: "事件概要",
            prop: "incidentOutline",
            isDisabled: true,
            class: "sjgy",
            lableWidth: "140px"
          }
        ],
        rules: {
          infoIds: [
            { required: true, message: "请选择预警信息", trigger: "bur" }
          ]
        }
      },
      // 弹窗表单信息
      formConfig1: {
        formData: [
          {
            type: "input",
            label: "预警研判单",
            isDisabled: false,
            prop: "judgeName",
            class: "half",
            lableWidth: "140px"
          },
          {
            type: "select",
            label: "是否启动预警",
            prop: "isWarningCode",
            name: "isWarning",
            isDisabled: false,
            class: "half",
            lableWidth: "140px",
            option: [
              { label: "否", value: 0 },
              { label: "是", value: 1 }
            ]
          },
          {
            type: "select",
            label: "险情类别",
            prop: "dangerCode",
            name: "dangerName",
            dic: "dic_xqlb",
            isDisabled: true,
            class: "half",
            lableWidth: "140px",
            option: []
          },
          {
            type: "select",
            label: "预警级别",
            prop: "warningLvCode",
            isDisabled: false,
            name: "warningLvName",
            dic: "dic_yjjb",
            class: "half",
            lableWidth: "140px",
            option: []
          },
          // {
          //   type: "input",
          //   label: "影响范围",
          //   prop: "effectRange",
          //   class: "half",
          //   lableWidth: "140px"
          // },
          {
            type: "selectTree",
            label: "影响范围",
            prop: "effectRange",
            name: "geo",
            title: "影响范围选择",
            choose: false,
            ref: "tree_select1",
            treeRef: "treeRef",
            class: "half",
            multiple: true,
            lableWidth: "140px",
            option: [],
            treeData: {
              data: [],
              checked: [],
              props: {
                children: "children",
                label: "extName",
                value: "geo"
              }
            }
          },
          {
            type: "dataPicker",
            label: "影响时间",
            prop: "effectStartTime",
            start: "effectStartTime",
            end: "effectEndTime",
            class: "half",
            dateType: "datetimerange",
            lableWidth: "140px"
          },
          {
            type: "textarea",
            label: "措施建议",
            prop: "measuresSuggestions",
            isDisabled: false,
            class: "sjgy",
            lableWidth: "140px"
          },
          {
            type: "select",
            label: "研判人",
            name: "judgeNames",
            prop: "judgeIds",
            isDisabled: false,
            filterable: true,
            class: "sjgy",
            multiple: true,
            lableWidth: "140px",
            option: []
          },
          {
            type: "dataPicker",
            label: "研判时间",
            prop: "judgeTime",
            isDisabled: false,
            limit: true,
            class: "half",
            dateType: "datetime",
            lableWidth: "140px"
          }
        ],
        rules: {
          judgeName: [
            {
              required: true,
              message: "请输入预警研判单名称",
              trigger: "change"
            }
          ],
          isWarningCode: [
            { required: true, message: "请选择是否启动预警", trigger: "change" }
          ],
          warningLvCode: [
            { required: true, message: "请选择预警级别", trigger: "change" }
          ],
          effectRange: [
            { required: true, message: "请选择影响范围", trigger: "blur" }
          ],
          measuresSuggestions: [
            { required: true, message: "请输入措施与建议", trigger: "change" }
          ],
          effectStartTime: [
            { required: true, message: "请选择影响时间", trigger: "change" }
          ],
          judgeTime: [
            { required: true, message: "请选择研判时间", trigger: "change" }
          ],
          judgeIds: [
            { required: true, message: "请选择研判人", trigger: "bur" }
          ]
        }
      },
      // 弹窗表单信息
      formConfig2: {
        formData: [
          {
            type: "input",
            label: "填报人",
            prop: "creator",
            isDisabled: true,
            class: "third",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "单位及部门",
            class: "third",
            isDisabled: true,
            prop: "unitDeptName",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "填报时间",
            class: "third",
            isDisabled: true,
            prop: "createTime",
            lableWidth: "140px"
          }
        ]
      },
      // 弹窗表单信息
      formConfig3: {
        formData: [
          {
            type: "input",
            label: "审批意见",
            isDisabled: false,
            prop: "approvalOpinion",
            class: "sjgy",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "审批人",
            isDisabled: true,
            prop: "approvalUser",
            class: "third",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "单位及部门",
            isDisabled: true,
            class: "third",
            prop: "approvalDept",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "审批时间",
            isDisabled: true,
            class: "third",
            prop: "approvalTime",
            lableWidth: "140px"
          }
        ]
      },
      // 弹窗表单信息
      formConfig4: {
        formData: [
          {
            type: "input",
            label: "预警研判单",
            prop: "judgeName",
            isDisabled: true,
            class: "half",
            lableWidth: "130px"
          },
          {
            type: "select",
            label: "是否启动预警",
            prop: "isWarningCode",
            name: "isWarning",
            isDisabled: true,
            class: "half",
            lableWidth: "130px",
            option: [
              { label: "否", value: 0 },
              { label: "是", value: 1 }
            ]
          },
          {
            type: "select",
            label: "险情类别",
            prop: "dangerName",
            name: "dangerName",
            dic: "dic_xqlb",
            isDisabled: true,
            class: "half",
            lableWidth: "130px",
            option: []
          },
          {
            type: "select",
            label: "预警级别",
            prop: "warningLvName",
            name: "warningLvName",
            isDisabled: true,
            dic: "dic_yjjb",
            class: "half",
            lableWidth: "130px",
            option: []
          },
          {
            type: "input",
            label: "影响范围",
            prop: "effectRange",
            isDisabled: true,
            class: "half",
            lableWidth: "130px"
          },
          {
            type: "dataPicker",
            label: "影响时间",
            start: "effectStartTime",
            isDisabled: true,
            end: "effectEndTime",
            class: "half",
            dateType: "datetimerange",
            lableWidth: "130px"
          },
          {
            type: "textarea",
            label: "措施建议",
            isDisabled: true,
            prop: "measuresSuggestions",
            class: "sjgy",
            lableWidth: "130px"
          },
          {
            type: "select",
            label: "研判人",
            prop: "judgeIds",
            isDisabled: true,
            name: "judgeNames",
            filterable: true,
            class: "sjgy",
            multiple: true,
            lableWidth: "130px",
            option: []
          },
          {
            type: "dataPicker",
            label: "研判时间",
            prop: "judgeTime",
            isDisabled: true,
            class: "half",
            dateType: "datetime",
            lableWidth: "130px"
          }
        ]
      },
      // 弹窗表单信息
      formConfig5: {
        formData: [
          {
            type: "input",
            label: "审批意见",
            isDisabled: true,
            prop: "approvalOpinion",
            class: "sjgy",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "审批人",
            isDisabled: true,
            prop: "approvalUser",
            class: "third",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "单位及部门",
            isDisabled: true,
            class: "third",
            prop: "approvalDept",
            lableWidth: "140px"
          },
          {
            type: "input",
            label: "审批时间",
            isDisabled: true,
            class: "third",
            prop: "approvalTime",
            lableWidth: "140px"
          }
        ]
      },
      infoIds: "",
      infoId: "",
      GenerateAlertNoticeId: "",
      fid: "",
      warningInfoNames: "",
      FilledBy: {},
      distinguish: 0,
      unitDeptName: "",
      deptId: "",
      creator: "",
      createId: "",
      str: "",
      effectRangeId: "",
      rangeInfo: [], // 影响范围,
      types: 0
    };
  },
  watch: {
    "$route.query.judgeState": {
      handler() {
        this.list();
      },
      deep: true
    }
  },
  mounted() {
    this.list();
    this.getInputVal();
    this.getUnitTree();
    const { type, id, types } = this.$route.query;
    if (id) {
      this.type = type;
      this.types = types;
      this.dialogConfig.isShow = true;
      this.formConfig3.formData[0].isDisabled = true;
      this.dialogConfig.btnList = [
        {
          name: "提交",
          id: "BSubmit", // 事件名
          type: "primary",
          size: "small"
        },
        {
          name: "保存",
          id: "submitForm",
          size: "small"
        },
        {
          name: "取消",
          id: "Qxiao",
          size: "small"
        }
      ];
      this.getInputVals();
      this.GoGetAlertInformation(id.split(","));
    }
    this.roleObj = JSON.parse(sessionStorage.getItem("role"));
    if (this.roleObj.roleCode === "province_company_leadership") {
      this.table.actions = [];
    }
    const accountObj = JSON.parse(sessionStorage.getItem("account"));
    const orgObj = JSON.parse(sessionStorage.getItem("org"));
    const FilledBy = {
      creator: accountObj.realName,
      creatorId: accountObj.id,
      deptId: orgObj.orgCode,
      // unitDeptName: orgObj.orgName,
      unitDeptName: sessionStorage.getItem("dwbmName"),
      createTime: showTime(new Date()),
      approvalUserId: accountObj.id,
      approvalUser: accountObj.realName,
      pprovalDeptId: orgObj.orgCode,
      // approvalDept: orgObj.orgName,
      approvalDept: sessionStorage.getItem("dwbmName"),
      approvalTime: showTime(new Date())
    };
    this.FilledBy = FilledBy;
  },
  created() {
    this.getIssueNoticeList();
  },
  methods: {
    // 树状接口
    getUnitTree() {
      getCityTree().then(res => {
        this.formConfig1.formData[4].treeData.data = res;
      });
    },
    // 影响范围
    handleNodeClick(data, node, item) {
      if (item.label === "影响范围") {
        const result = this.$refs.formComponent1.form.effectRange;
        const datas = data.children || [];
        if (datas.length > 0) {
          if (result.includes(data.extName)) return;
          else {
            this.$refs.formComponent1.form.effectRange.push(data.extName);
            this.$refs.formComponent1.form.geo.push(data.geo);
            const obj = { effectRange: data.extName, locationId: data.id, geo: data.geo, locationDeep: Number(data.deep) };
            this.rangeInfo.push(obj);
          }
        } else {
          if (result.includes(`${node.parent.data.extName}${data.extName}`) || result.includes(`${data.extName}`)) return;
          else {
            if (node.parent.data.extName) {
              this.$refs.formComponent1.form.effectRange.push(`${node.parent.data.extName}${data.extName}`);
              const obj = { effectRange: `${node.parent.data.extName}${data.extName}`, locationId: data.id, geo: data.geo, locationDeep: Number(data.deep) };
              this.rangeInfo.push(obj);
            } else {
              const obj = { effectRange: `${data.extName}`, locationId: data.id, geo: data.geo, locationDeep: Number(data.deep) };
              this.$refs.formComponent1.form.effectRange.push(`${data.extName}`);
              this.rangeInfo.push(obj);
            }
            this.$refs.formComponent1.form.geo.push(data.geo);
          }
        }
      }
    },
    // 多选删除
    removeTag(val) {
      this.rangeInfo.splice(this.rangeInfo.findIndex(item => item.effectRange === val), 1);
    },
    getIssueNoticeList() {
      this.formData.forEach((item) => {
        if (item.label === "关联预警通知单") {
          getIssueNoticeList({ pageNum: 1, pageSize: 10 }).then(res => {
            const option = res.data.map((item) => {
              return {
                label: item.warningNoticeName,
                value: item.id
              };
            });
            item.options = option;
          });
        }
      });
    },
    // 研判处理结果详情
    async yjtzd(id) {
      this.GenerateAlertNoticeId = id.id;
      this.dialogConfig1.isShow = true;
      getByIds({ id: id.id }).then(res => {
        this.getInputVals();
        this.type = 0;
        const resw = new Map();
        const rangeDetailVos = res.rangeDetailVos.filter(item => !resw.has(item.effectRange) && resw.set(item.effectRange, 1)).map(items => { return items.effectRange; });
        this.$set(this.$refs.formComponent4.form, "judgeName", res.judgeName);
        this.$set(this.$refs.formComponent4.form, "dangerName", res.dangerName);
        this.$set(this.$refs.formComponent4.form, "dangerCode", Number(res.dangerCode));
        this.$set(this.$refs.formComponent4.form, "warningLvName", res.warningLvName);
        this.$set(this.$refs.formComponent4.form, "warningLvCode", Number(res.warningLvCode));
        this.$set(this.$refs.formComponent4.form, "isWarning", res.isWarning);
        this.$set(this.$refs.formComponent4.form, "isWarningCode", Number(res.isWarningCode));
        this.$set(this.$refs.formComponent4.form, "effectRange", rangeDetailVos.join("、"));
        this.$set(this.$refs.formComponent4.form, "measuresSuggestions", res.measuresSuggestions);
        this.$set(this.$refs.formComponent4.form, "judgeIds", res.judgeIds.split(","));
        this.$set(this.$refs.formComponent4.form, "judgeNames", res.judgeNames);
        this.$set(this.$refs.formComponent4.form, "judgeTime", res.judgeTime);
        this.$refs.formComponent5.form = res;
        this.$set(this.$refs.formComponent4.form, "effectStartTime", res.effectStartTime);
        this.$set(this.$refs.formComponent4.form, "effectEndTime", res.effectEndTime);
      });
    },
    // 生成预警通知单
    GenerateAlertNotice() {
      this.$router.push({
        name: "NoticeList",
        query: {
          id: this.GenerateAlertNoticeId,
          type: 1,
          types: 2
        }
      });
    },
    // 弹窗按钮点击事件 对应id绑定事件
    async handleBtn(item) {
      this[item.id]();
    },
    handleBtn1(item) {
      this[item.id]();
    },
    // 重置
    reset() {
      this.form = this.$options.data().form;
      this.$refs.gjxm.paginationAtrrsInner["current-page"] = 1;
      this.list();
    },
    // 获取下拉框数据
    getInputVals() {
      this.formConfig1.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: item.dicCode
              };
            });
            item.option = option;
          });
        }
      });
    },
    // 检索
    async query() {
      // const parmas = {
      //   pageNum: this.pageNum,
      //   pageSize: this.pageSize,
      //   isWarningCode: this.form.isWarningCode,
      //   judgeState: this.form.judgeState,
      //   judgeName: this.form.judgeName,
      //   dangerCode: this.form.dangerCode,
      //   warningLvCode: this.form.warningLvCode,
      //   effectRange: this.form.effectRange,
      //   judgeStartTime: this.form.judgeTime ? this.form.judgeTime[0] : "",
      //   judgeEndTime: this.form.judgeTime ? this.form.judgeTime[1] : "",
      //   noticeId: this.form.noticeId
      // };
      // const res = await listPagey(parmas);
      // this.table.tableData = res.data;
      // this.paginationAtrrs.total = res.total;
      this.list({ ...this.form });
    },
    gzlSubmit(bizKey) {
      const data = {
        bizKey,
        flowKey: "warning_test_001",
        taskId: "task1",
        callbackUrl: "/warning/warningJudge/handleFlow",
        idea: "1"
      };
      const successCallBack = () => {
        this.$message({
          message: "提交成功",
          type: "success"
        });
        this.dialogConfig.isShow = false;
        this.$router.push({ query: { judgeState: 1 } });
        this.list();
      };
      flowSubmit(data, successCallBack, "提交", true);
    },
    // 保存
    async submitForm() {
      this.$refs.formComponent.isValidate();
      this.$refs.formComponent1.isValidate();
      const flag = this.$refs.formComponent.flag;
      const flag1 = this.$refs.formComponent1.flag;
      if (flag && flag1) {
        const formData1 = this.$refs.formComponent1.form || {};
        const formData = this.$refs.formComponent.form || {};
        const parmas = {
          infoId: this.infoId,
          infoIds: this.infoIds,
          dangerCode: formData1.dangerCode,
          dangerName: formData1.dangerName,
          effectEndTime: formData1.effectEndTime,
          rangeInfo: this.rangeInfo,
          effectStartTime: formData1.effectStartTime,
          warningLvCode: formData1.warningLvCode,
          warningLvName: formData1.warningLvName,
          judgeTime: formData1.judgeTime,
          judgeIds: formData1.judgeIds.join(),
          judgeNames: formData1.judgeNames instanceof Array ? formData1.judgeNames.join("、") : formData1.judgeNames,
          measuresSuggestions: formData1.measuresSuggestions,
          judgeName: formData1.judgeName,
          incidentOutline: formData.incidentOutline,
          isWarningCode: formData1.isWarningCode,
          isWarning: formData1.isWarning,
          warningInfoNames: formData.warningInfoNames instanceof Array ? formData.warningInfoNames.join() : formData.warningInfoNames,
          locationId: this.effectRangeId
        };
        parmas.creator = this.FilledBy.creator;
        parmas.creatorId = this.FilledBy.creatorId;
        parmas.unitDeptName = this.FilledBy.unitDeptName;
        parmas.deptId = this.FilledBy.deptId;
        if (this.type === 1 || this.type === 0) {
          if (this.fid) {
            parmas.id = this.fid;
            const res = await updById(parmas);
            if (res) {
              this.$message({
                message: "修改成功",
                type: "success"
              });
              this.$router.push({ query: { isHaveEditButton: 1, judgeState: 0 } });
              this.list();
              this.dialogConfig.isShow = false;
            }
          } else {
            const res = await saveAdd(parmas);
            if (res) {
              this.$message({
                message: "保存成功",
                type: "success"
              });
              this.$router.push({ query: { isHaveEditButton: 1, judgeState: 0 } });
              this.list();
              this.dialogConfig.isShow = false;
            }
          }
        } else if (this.type === 2 || this.types === 2) {
          if (this.fid) {
            parmas.id = this.fid;
            const res = await updById(parmas);
            if (res) {
              this.gzlSubmit(this.fid);
            }
          } else {
            const res = await saveAdd(parmas);
            if (res) {
              this.gzlSubmit(res);
            }
          }
        } else if (this.type === 3) {
          parmas.approvalDept = this.FilledBy.approvalDept;
          parmas.approvalUser = this.FilledBy.approvalUser;
          parmas.id = this.fid;
          this.gzlAudit(3, parmas);
        } else if (this.type === 4) {
          parmas.approvalDept = this.FilledBy.approvalDept;
          parmas.approvalUser = this.FilledBy.approvalUser;
          parmas.id = this.fid;
          this.gzlAudit(4, parmas);
        }
      }
    },
    gzlAudit(type, variable) {
      const data = {
        bizKey: this.fid,
        flowKey: "warning_test_001",
        taskId: "task2",
        callbackUrl: "/warning/warningJudge/handleFlow",
        idea: type === 3 ? "1" : "0",
        variable,
        ideaMsg: this.$refs.formComponent3.form.approvalOpinion ? this.$refs.formComponent3.form.approvalOpinion : type === 3 ? "同意" : "驳回"
      };
      const successCallBack = () => {
        this.$message({
          message: `${type === 3 ? "审核" : "驳回"}成功`,
          type: "success"
        });
        this.dialogConfig.isShow = false;
        this.list();
      };
      flowSubmit(data, successCallBack, "审核");
    },
    // 提交
    async BSubmit() {
      this.type = 2;
      this.submitForm();
    },
    // 取消
    Qxiao() {
      this.rangeInfo = [];
      this.$refs.formComponent.form = this.$refs.formComponent.$options.data().form;
      this.$refs.formComponent1.form = this.$refs.formComponent1.$options.data().form;
      this.$refs.formComponent2.form = this.$refs.formComponent2.$options.data().form;
      this.$nextTick(() => {
        this.$refs.formComponent.$refs.formInlines.clearValidate();
        this.$refs.formComponent1.$refs.formInlines.clearValidate();
        this.$refs.formComponent2.$refs.formInlines.clearValidate();
      });
      this.dialogConfig.isShow = false;
      if (this.$route.query.type === 1) {
        this.$router.push({
          name: "InformationList",
          query: { warningInfoStatus: 1 }
        });
      }
      // this.$router.push({ query: { judgeState: this.$route.query.judgeState } });
      this.dialogConfig1.isShow = false;
      this.tables.tableData = [];
    },
    // 弹窗关闭图标
    close() {
      this.rangeInfo = [];
      this.$refs.formComponent.form = this.$refs.formComponent.$options.data().form;
      this.$refs.formComponent1.form = this.$refs.formComponent1.$options.data().form;
      this.$refs.formComponent2.form = this.$refs.formComponent2.$options.data().form;
      this.$nextTick(() => {
        this.$refs.formComponent.$refs.formInlines.clearValidate();
        this.$refs.formComponent1.$refs.formInlines.clearValidate();
        this.$refs.formComponent2.$refs.formInlines.clearValidate();

      });
      this.dialogConfig.isShow = false;
      this.dialogConfig1.isShow = false;
      if (this.$route.query.type === 1) {
        this.$router.push({
          name: "InformationList",
          query: { warningInfoStatus: 1 }
        });
      }
      this.tables.tableData = [];
    },
    // 弹窗关闭图标
    close1() {
      this.dialogConfig1.isShow = false;
    },
    // 获取下拉框数据
    getInputVal() {
      this.formConfig1.formData.forEach((item) => {
        if (item.label === "研判人") {
          getPersonApi({ orgId: JSON.parse(sessionStorage.getItem("org")).orgId }).then(res => {
            const option = res.map((item) => {
              const phone = item.phone === null ? "" : `：(${item.phone})`;
              return {
                label: `${item.orgName}${item.realName} ${phone}`,
                value: item.id
              };
            });
            item.option = option;
          });
        }
      });
      this.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: Number(item.dicCode)
              };
            });
            item.options = option;
          });
        }
      });
      this.formConfig.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: Number(item.dicCode)
              };
            });
            item.option = option;
          });
        }
      });
      this.formConfig1.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroup({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: Number(item.dicCode)
              };
            });
            item.option = option;
          });
        }
      });
    },
    // 列表
    async list(val) {
      if (this.$route.query.judgeState === "0") {
        let parmas = {
          pageNum: this.pageNum,
          pageSize: this.pageSize,
          isHaveEditButton: this.$route.query.isHaveEditButton,
          roleCode: this.roleObj.roleCode
        };
        if (val) {
          parmas = { ...parmas, ...val };
        }
        const res = await listPagey(parmas);
        this.table.tableData = res.data;
        this.paginationAtrrs.total = res.total;
      } else {
        let sta = "";
        if (this.$route.query.judgeState) {
          sta = this.$route.query.judgeState;
        } else {
          sta = this.form.judgeState;
        }
        let parmas = {
          pageNum: this.pageNum,
          pageSize: this.pageSize,
          judgeState: sta,
          roleCode: this.roleObj.roleCode
        };
        if (val) {
          parmas = { ...parmas, ...val };
        }
        const res = await listPagey(parmas);
        this.table.tableData = res.data;
        this.paginationAtrrs.total = res.total;
      }
    },
    // 抛出列表按钮
    onActionClick(item, index) {
      this[item.id](); // 调用按钮对应方法
    },
    // 新增
    dialogVisible() {
      this.dialogConfig.isShow = true;
      this.$nextTick(() => {
        this.$refs.formComponent2.form = this.FilledBy;
        this.$set(this.$refs.formComponent1.form, "effectRange", []);
        this.$set(this.$refs.formComponent1.form, "geo", []);
      });
      this.type = 1;
      this.GetAlertInformation();
      this.getInputVals();
      this.dialogConfig.btnList = [
        {
          name: "提交",
          id: "BSubmit", // 事件名
          type: "primary",
          size: "small"
        },
        {
          name: "保存",
          id: "submitForm",
          size: "small"
        },
        {
          name: "取消",
          id: "Qxiao",
          size: "small"
        }
      ];
    },
    // 获取预警信息下拉的数据
    GetAlertInformation() {
      this.formConfig.formData.map(item => {
        if (item.label === "预警信息") {
          warningJudgeGetNoJudgeInfo().then(res => {
            const option = res.map((item) => {
              return {
                label: item.warningInfo,
                value: item.id
              };
            });
            item.option = option;

          });
        }
      });
    },
    // 列表表格按钮事件
    actionHandle(item, scope) {
      if (item === "编辑") {
        this.HanEdit(scope.row);
        console.log(scope.row);
      } else if (item === "删除") {
        this.detailForm(scope.row);
      } else if (item === "审批") {
        this.ApprovalForm(scope.row);
      } else if (item === "生成预警通知单") {
        this.yjtzd(scope.row);
      }
    },
    // 预警信息 下拉监听
    handleChange(val) {
      this.infoIds = val.join();
      warningJudgeGetInfoData({ ids: val.join() }).then(data => {
        this.infoId = data.id;
        this.rangeInfo = data.rangeDetailVos;
        const res = new Map();
        const rangeDetailVos = data.rangeDetailVos.filter(item => !res.has(item.effectRange) && res.set(item.effectRange, 1)).map(items => { return items.effectRange; });
        this.$nextTick(() => {
          const res = new Map();
          const effectRange = [];
          const geo = [];
          data.rangeDetailVos.filter(item => !res.has(item.effectRange) && res.set(item.effectRange, 1)).map(items => {
            effectRange.push(items.effectRange);
            geo.push(items.geo);
          });
          this.$set(this.$refs.formComponent1.form, "effectRange", effectRange);
          this.$set(this.$refs.formComponent1.form, "geo", geo);
        });
        this.$set(this.$refs.formComponent.form, "incidentOutline", data.incidentOutline);
        this.$set(this.$refs.formComponent.form, "dangerName", data.dangerName);
        this.$set(this.$refs.formComponent.form, "dangerCode", Number(data.dangerCode));
        this.$set(this.$refs.formComponent.form, "warningLvName", data.warningLvName);
        this.$set(this.$refs.formComponent.form, "warningLvCode", Number(data.warningLvCode));
        this.$set(this.$refs.formComponent.form, "effectRange", rangeDetailVos.join(","));
        this.$set(this.$refs.formComponent.form, "yxTime", [data.effectStartTime, data.effectEndTime]);
        this.$set(this.$refs.formComponent1.form, "dangerName", data.dangerName);
        this.$set(this.$refs.formComponent1.form, "dangerCode", Number(data.dangerCode));
        this.$set(this.$refs.formComponent1.form, "warningLvName", data.warningLvName);
        this.$set(this.$refs.formComponent1.form, "warningLvCode", data.warningLvCode);
        this.$set(this.$refs.formComponent1.form, "effectStartTime", data.effectStartTime);
        this.$set(this.$refs.formComponent1.form, "effectEndTime", data.effectEndTime);
        this.$set(this.$refs.formComponent.form, "effectStartTime", data.effectStartTime);
        this.$set(this.$refs.formComponent.form, "effectEndTime", data.effectEndTime);
        this.$set(this.$refs.formComponent1.form, "judgeName", `${data.warningInfo}研判单`);
        getJudgeStandard({ dangerCode: data.dangerCode }).then(res => {
          this.tables.tableData = res;
          const warningLvName = res.filter((i) => {
            if (i.warningLvName === data.warningLvName) {
              return i;
            }
          });
          var str = "";
          for (var i = 0; i < warningLvName.length; i++) {
            str += warningLvName[i].startCondition;
          }
          this.str = str;
          this.$set(this.$refs.formComponent1.form, "measuresSuggestions", str);
        });
      });
    },
    // 预警信息研判
    GoGetAlertInformation(val) {
      this.GetAlertInformation();
      // this.getInputVals()
      this.infoIds = this.$route.query.id;
      this.$nextTick(() => {
        this.$refs.formComponent2.form = this.FilledBy;
        this.$set(this.$refs.formComponent.form, "infoIds", val);
      });
      warningJudgeGetInfoData({ ids: val.join(",") }).then(data => {
        this.infoId = data.id;
        this.rangeInfo = data.rangeDetailVos;
        const res = new Map();
        const rangeDetailVos = data.rangeDetailVos.filter(item => !res.has(item.effectRange) && res.set(item.effectRange, 1)).map(items => { return items.effectRange; });
        this.$nextTick(() => {
          const res = new Map();
          const effectRange = [];
          const geo = [];
          data.rangeDetailVos.filter(item => !res.has(item.effectRange) && res.set(item.effectRange, 1)).map(items => {
            effectRange.push(items.effectRange);
            geo.push(items.geo);
          });
          this.$set(this.$refs.formComponent1.form, "effectRange", effectRange);
          this.$set(this.$refs.formComponent1.form, "geo", geo);
        });
        // this.$set(this.$refs.formComponent1.form, "geo", data.geo);
        this.$set(this.$refs.formComponent.form, "incidentOutline", data.incidentOutline);
        this.$set(this.$refs.formComponent.form, "dangerName", data.dangerName);
        this.$set(this.$refs.formComponent.form, "dangerCode", Number(data.dangerCode));
        this.$set(this.$refs.formComponent.form, "warningLvName", data.warningLvName);
        this.$set(this.$refs.formComponent.form, "warningLvCode", Number(data.warningLvCode));
        this.$set(this.$refs.formComponent.form, "effectRange", rangeDetailVos.join("、"));
        this.$set(this.$refs.formComponent.form, "effectStartTime", data.effectStartTime);
        this.$set(this.$refs.formComponent.form, "effectEndTime", data.effectEndTime);
        // this.$set(this.$refs.formComponent1.form, "effectRange", data.effectRange);
        this.$set(this.$refs.formComponent1.form, "dangerName", data.dangerName);
        this.$set(this.$refs.formComponent1.form, "dangerCode", Number(data.dangerCode));
        this.$set(this.$refs.formComponent1.form, "warningLvName", data.warningLvName);
        this.$set(this.$refs.formComponent1.form, "warningLvCode", data.warningLvCode);
        this.$set(this.$refs.formComponent1.form, "effectStartTime", data.effectStartTime);
        this.$set(this.$refs.formComponent1.form, "effectEndTime", data.effectEndTime);
        this.$set(this.$refs.formComponent1.form, "judgeName", `${data.warningInfo}研判单`);
        this.$set(this.$refs.formComponent.form, "warningInfoNames", data.warningInfo);
        getJudgeStandard({ dangerCode: data.dangerCode }).then(res => {
          this.tables.tableData = res;
          const warningLvName = res.filter((i) => {
            if (i.warningLvName === data.warningLvName) {
              return i;
            }
          });
          var str = "";
          for (var i = 0; i < warningLvName.length; i++) {
            str += warningLvName[i].startCondition;
          }
          this.str = str;
          if (this.str.length > 0) {
            this.str = this.str.substr(0, str.length - 1);
          }
          // //去掉最后一个逗号(如果不需要去掉，就不用写)
          this.$set(this.$refs.formComponent1.form, "measuresSuggestions", this.str);
        });
      });
    },
    // 详情
    detailList(id) {
      this.$router.push({
        name: "EarlyJudgmentDetail",
        query: { id: id.id }
      });
    },
    // 选择器
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    // 审批编辑处理
    ApproveEdit(id) {
      this.dialogConfig.isShow = true;
      // this.GetAlertInformation()
      this.getInputVals();
      getByIds({ id: id.id }).then(res => {
        this.$refs.formComponent2.form = res;
        this.unitDeptName = res.unitDeptName;
        this.deptId = res.deptId;
        this.creator = res.creator;
        this.createId = res.createId;
        this.type = 0;
        this.fid = res.id;
        this.infoId = res.infoId;
        this.infoIds = res.infoIds;
        this.rangeInfo = res.rangeDetailVos;
        this.$nextTick(() => {
          const ress = new Map();
          const effectRange = [];
          const geo = [];
          res.rangeDetailVos.filter(item => !ress.has(item.effectRange) && ress.set(item.effectRange, 1)).map(items => {
            effectRange.push(items.effectRange);
            geo.push(items.geo);
          });
          this.$set(this.$refs.formComponent1.form, "effectRange", effectRange);
          this.$set(this.$refs.formComponent1.form, "geo", geo);
        });
        this.$set(this.$refs.formComponent1.form, "judgeName", res.judgeName);
        this.$set(this.$refs.formComponent1.form, "dangerName", res.dangerName);
        this.$set(this.$refs.formComponent1.form, "dangerCode", Number(res.dangerCode));
        this.$set(this.$refs.formComponent1.form, "warningLvName", res.warningLvName);
        this.$set(this.$refs.formComponent1.form, "warningLvCode", res.warningLvCode);
        this.$set(this.$refs.formComponent1.form, "isWarningCode", Number(res.isWarningCode));
        this.$set(this.$refs.formComponent1.form, "isWarning", res.isWarning);
        this.$set(this.$refs.formComponent1.form, "measuresSuggestions", res.measuresSuggestions);
        this.$set(this.$refs.formComponent1.form, "judgeNames", res.judgeNames);
        this.$set(this.$refs.formComponent1.form, "judgeIds", res.judgeIds.split(","));
        this.$set(this.$refs.formComponent1.form, "judgeTime", res.judgeTime);
        this.$set(this.$refs.formComponent1.form, "effectStartTime", res.effectStartTime);
        this.$set(this.$refs.formComponent1.form, "effectEndTime", res.effectEndTime);
        this.$set(this.$refs.formComponent1.form, "isCreate", Number(res.isCreate));
        this.$set(this.$refs.formComponent1.form, "isWarning", res.isWarning);
        this.formConfig.formData.map(item => {
          if (item.label === "预警信息") {
            getEditNoJudgeInfo({ infoIds: res.infoIds }).then(res => {
              const option = res.map((item) => {
                return {
                  label: item.warningInfo,
                  value: item.id
                };
              });
              item.option = option;
            });
          }
        });
        this.$set(this.$refs.formComponent.form, "infoIds", res.infoIds.split(","));
        this.$set(this.$refs.formComponent.form, "warningInfoNames", res.warningInfoNames);
        getById({ id: res.infoId }).then(res => {
          const ress = new Map();
          const rangeDetailVos = res.rangeDetailVos.filter(item => !ress.has(item.effectRange) && ress.set(item.effectRange, 1)).map(items => { return items.effectRange; });
          console.log(res.rangeDetailVos, "res.rangeDetailVosres.rangeDetailVos");
          this.$set(this.$refs.formComponent.form, "effectRange", rangeDetailVos.join(","));
          this.$set(this.$refs.formComponent.form, "effectStartTime", res.effectStartTime);
          this.$set(this.$refs.formComponent.form, "effectEndTime", res.effectEndTime);
          this.$set(this.$refs.formComponent.form, "incidentOutline", res.incidentOutline);
          this.$set(this.$refs.formComponent.form, "dangerName", res.dangerName);
          this.$set(this.$refs.formComponent.form, "dangerCode", Number(res.dangerCode));
          this.$set(this.$refs.formComponent.form, "warningLvName", res.warningLvName);
          this.$set(this.$refs.formComponent.form, "warningLvCode", Number(res.warningLvCode));
          getJudgeStandard({ dangerCode: res.dangerCode }).then(res => {
            this.tables.tableData = res;
          });
          // 编辑
          if (this.distinguish === 0) {
            this.dialogConfig.btnList = [
              {
                name: "提交",
                id: "BSubmit", // 事件名
                type: "primary",
                size: "small"
              },
              {
                name: "保存",
                id: "submitForm",
                size: "small"
              },
              {
                name: "取消",
                id: "Qxiao",
                size: "small"
              }
            ];
            // 审批
          } else if (this.distinguish === 1) {
            this.formConfig1.disabled = true;
            const effectRange = [];
            this.rangeInfo.map(item => {
              effectRange.push(item.effectRange);
            });
            this.$set(this.$refs.formComponent1.form, "effectRange", effectRange.join("、"));
            this.dialogConfig.btnList = [
              {
                name: "同意",
                id: "AgreeFrom", // 事件名
                type: "primary",
                size: "small"
              },
              {
                name: "驳回",
                id: "RejectFrom",
                size: "small"
              },
              {
                name: "取消",
                id: "Qxiao",
                size: "small"
              }
            ];
          }
        });
      });
    },
    // 编辑
    HanEdit(id) {
      this.ApproveEdit(id);
      this.distinguish = 0;
    },
    // 审批
    ApprovalForm(id) {
      this.titleConfig = [
        {
          title: "信息来源",
          name: "1",
          slot: "slot1"
        },
        {
          title: "措施要求",
          name: "2",
          slot: "slot2"
        },
        {
          title: "预警对象",
          name: "3",
          slot: "slot3"
        },
        {
          title: "填报信息",
          name: "4",
          slot: "slot4"
        },
        {
          title: "审批信息",
          name: "5",
          slot: "slot5"
        }
      ];
      this.$nextTick(() => {
        this.$refs.formComponent3.form = this.FilledBy;
      });
      this.ApproveEdit(id);
      this.distinguish = 1;
      this.formConfig.formData[0].isDisabled = true;
      this.formConfig1.formData[0].isDisabled = true;
      this.formConfig1.formData[1].isDisabled = true;
      this.formConfig1.formData[3].isDisabled = true;
      this.formConfig1.formData[4].isDisabled = true;
      this.formConfig1.formData[4].type = "input";
      this.formConfig1.formData[5].isDisabled = true;
      this.formConfig1.formData[6].isDisabled = true;
      this.formConfig1.formData[7].isDisabled = true;
      this.formConfig1.formData[8].isDisabled = true;
      this.formConfig1.rules = {};
      this.formConfig.rules = {};
    },
    // 同意
    async AgreeFrom() {
      this.type = 3;
      this.submitForm();
    },
    // 驳回
    async RejectFrom() {
      this.type = 4;
      this.submitForm();
    },
    // 列表删除
    detailForm(id) {
      this.$confirm("此操作将永久删除该条数据, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        deleteById({
          id: id.id
        }).then(data => {
          if (data) {
            this.$message({
              message: "删除成功",
              type: "success"
            });
            this.list();
          }
        });
      }).catch(() => {
        this.$message({
          type: "info",
          message: "已取消删除"
        });
      });
    },
    // 分页
    handleSizeChange(val) {
      this.pageNum = val["current-page"];
      this.pageSize = val["page-size"];
      this.list({ ...this.form });
    },
    // 时间提示
    pickerChange(val, item, num) {
      this.$nextTick(() => {
        if (
          this.$refs.formComponent1.form.effectStartTime &&
          this.$refs.formComponent1.form.effectEndTime
        ) {
          const start = +new Date(
            this.$refs.formComponent1.form.effectStartTime
          );
          const end = +new Date(this.$refs.formComponent1.form.effectEndTime);
          if (num === 1) {
            if (start > end) {
              this.$message({
                message: "开始时间不能大于结束时间",
                type: "error"
              });
              this.$set(this.$refs.formComponent1.form, "effectStartTime", "");
            }
          } else {
            if (end < start) {
              this.$message({
                message: "结束时间不能小于开始时间",
                type: "error"
              });
              this.$set(this.$refs.formComponent1.form, "effectEndTime", "");
            }
          }
        }
      });
    }
  }
};
</script>

<style scoped lang="less">
@import "../../../assets/style/common.less";
@import "../../../assets/style/ComponentStyle.less";
@import "../../../assets/style/pop-upNotification.less";

:deep(.el-breadcrumb__inner.is-link) {
  font-weight: 100;
  color: #fff;
}

:deep(.el-table--striped .el-table__body tr.el-table__row--striped.el-table__row--striped.el-table__row--striped td) {
  background-color: #f8f9f8;
  /*隔行变色*/
}

:deep(.el-tag.el-tag--info) {
  background-color: rgba(185, 206, 250) !important;
  color: #333333 !important;
  border-radius: 0px !important;
  height: 25px;
  font-size: 15px !important;
  border: none;
}

:deep(.el-select .el-tag__close.el-icon-close) {
  background: none;
  font-size: 16px;
}

//鼠标悬浮样式
:deep(tr.hover-row) {

  &,
  &.el-table__row--striped {

    &,
    &.current-row {
      >td.el-table__cell {
        background: none;
      }
    }
  }
}

.EmergencyList {
  height: 97% !important;
}

.EmergencyList :deep(.el-breadcrumb__item:last-child .el-breadcrumb__inner) {
  color: #3270ff;
}

.box {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 15px;
  background-color: #fff;
  border-radius: 4px;
  padding: 10px;
  box-sizing: border-box;
}

:deep(.el-popover__reference) {
  border: none;
}

:deep(.el-breadcrumb) {
  font-size: 16px;
  line-height: initial;
}

:deep(.el-tag__close) {
  background-color: rgba(185, 206, 250) !important;
  color: #333333 !important;
  border-radius: 0px !important;
  height: 25px;
  font-size: 15px !important;
  border: none !important;
}

:deep(.el-tag.el-tag--info) {
  background-color: rgba(185, 206, 250) !important;
  color: #333333 !important;
  border-radius: 0px !important;
  height: 25px;
  font-size: 15px !important;
  border: none !important;
}
</style>
